<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="extLibs" value="validate"/>
<sys:header title="疗休养申请管理 - ${restApply.isNewRecord ? '新增' : '编辑'}疗休养申请" extLibs="${extLibs}"/>
<link href="${ctxStatic}/common/css/form.css" rel="stylesheet" type="text/css">

<div class="portlet box ${boxStyleColor} autoHeight">
	<div class="portlet-body form">
		<form:form id="inputForm" modelAttribute="restApply" action="" method="post" class="form-horizontal">

			<div class="tool">
				<c:if test="${type=='1'}">
					<c:if test="${restApply.approveStatus=='1'}">

						<input id="btnSubmit" type="button" value="通过" class="tool1">
						<input id="btnSubmit1" type="button" value="退回" class="tool1">
					</c:if>
				</c:if>
				<c:if test="${type=='2'}">
					<c:if test="${restApply.approveStatus=='2'}">
						<input id="btnSubmit2" type="button" value="通过" class="tool1">
						<input id="btnSubmit3" type="button" value="退回" class="tool1">

					</c:if>
				</c:if>
				<input id="btnCancel" type="button" value="关闭" class="tool1" onclick="closeCurrentTabPage('${param.parentTabPageId}')">
			</div>
			<div class="biaodan_bg">
				<div class="biaodan">
					<table width="100%" border="0" class="tb2">
						<tr>
							<td colspan="8" align="center"  ><strong style="font-size:24px; font-weight:normal;">${fns:getConfig('university')}疗休养申请表</strong></td>
						</tr>
					</table>
						<table width="100%" border="0" class="tb4">

							<form:hidden path="id"/>
							<form:hidden path="approveStatus"/>

							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">姓名</td>
								<td width="120">
									<form:hidden path="memberCode"/>
									<form:input path="memberName" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">性别</td>
								<td width="120">
									<form:select path="sex" multiple="false" class="form-control required input-sm"  >
										<form:options items="${fns:getDictList('sex')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
									</form:select>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">年龄</td>
								<td width="120">
									<form:input path="age" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">分工会</td>
								<td width="120">
									<form:hidden path="officeCode"/>
									<form:input path="officeName" htmlEscape="false" maxlength="64" class="form-control required"/>


								<%--<sys:treeselect id="office" name="officeCode" value="${restApply.officeCode}" labelName="officeName" labelValue="${restApply.officeName}"--%>
										<%--title="分工会" url="/sys/office/treeData?type=2" cssClass="" allowClear="true" notAllowSelectParent="true"/>--%>

								</td>
							</tr>



							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">职务</td>
								<td width="120">
									<form:input path="duty" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">手机</td>
								<td width="120">
									<form:input path="phone" htmlEscape="false" maxlength="64" class="form-control required"/>

								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">线路</td>
								<td width="120">
									<form:select path="lineCode" multiple="false" cssClass="form-control" class="form-control  input-sm" onchange="">
										<%--<form:option value=""></form:option>--%>
										<form:options items="${lineList}"  itemLabel="lineName" itemValue="lineCode" htmlEscape="false"></form:options>
									</form:select>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">出发校区</td>
								<td width="120">
									<form:select path="campus" multiple="false" class="form-control required input-sm"  >
										<form:options items="${fns:getDictList('campus')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
									</form:select>
								</td>
							</tr>
							<tr>
								<td class="text-center" bgcolor="#f5f5f5">申请理由</td>
								<td colspan="7">
									<form:textarea path="reason" htmlEscape="false" rows="8" maxlength="200" class="form-control required input-sm"/>
								</td>
							</tr>
							<tr>
								<td class="text-center" bgcolor="#f5f5f5">分工会审批意见</td>
								<td colspan="7">
									<form:textarea path="approveMemo1" htmlEscape="false" rows="8" maxlength="200" class="form-control required input-sm"/>
								</td>
							</tr>

							<c:if test="${type=='2'}">

								<tr>
									<td class="text-center" bgcolor="#f5f5f5">校工会审批意见</td>
									<td colspan="7">
										<form:textarea path="approveMemo2" htmlEscape="false" rows="8" maxlength="200" class="form-control required input-sm"/>
									</td>
								</tr>
							</c:if>


						</table>
						<div class="hide">
							<input type="hidden" id="flowId" name="flowId"/>
							<sys:listselect id="approval" name="approvalCode" value="" labelName="approvalName" labelValue=""
											boxHeight="500"	boxWidth="450" returnCodeAttr="userCode" returnNameAttr="userName"	title="审批人" url="" multiple="true" cssClass="form-control"  />
						</div>
				</div>
			</div>


		</form:form>
	</div>
</div>
<sys:footer extLibs="${extLibs}"/>
<script type="text/javascript">
	$("#inputForm").validate({
		submitHandler: function(form){
			ajaxSubmitForm($(form), function(data){
				showMessage(data.message);
				if(data.result == Global.TRUE){
					closeCurrentTabPage('${param.parentTabPageId}', function(contents, contentWindow){
						contentWindow.page();
					});
				}
			}, "json");
	    }
	});
	$('#btnSubmit').click(function(){

		$("#approveStatus").val("2");

		$("#inputForm").attr("action","${ctx}/rst/restApply/updateApproveStatusFen");
		$("#inputForm").submit();
	});

	$('#btnSubmit1').click(function(){
		$("#approveStatus").val("3");

		$("#inputForm").attr("action","${ctx}/rst/restApply/updateApproveStatusFen");
		$("#inputForm").submit();
	});



	$('#btnSubmit2').click(function(){
		$("#approveStatus").val("4");

		$("#inputForm").attr("action","${ctx}/rst/restApply/updateApproveStatusXiao");
		$("#inputForm").submit();
	});

	$('#btnSubmit3').click(function(){
		$("#approveStatus").val("5");

		$("#inputForm").attr("action","${ctx}/rst/restApply/updateApproveStatusXiao");
		$("#inputForm").submit();
	});
</script>